const list = require('./modules/list')
const set = require('./modules/set')
const getConfig = require('./modules/getConfig')
const getOssConfig = require('./modules/getOssConfig')
const put = require('./modules/put')
const get = require('./modules/get')
const del = require('./modules/del')

const OssFn = function (config) {
    this.getOssConfig = getOssConfig.bind(OssFn)
    this.list = (params) => list.call(this, { config, ...params })
    this.put = (params) => put.call(this, { config, ...params })
    this.get = (params) => get.call(this, { config, ...params })
    this.del = (params) => del.call(this, { config, ...params })

    return this
}

OssFn.setOssConfigPath = set.bind(OssFn)
OssFn.getConfig = getConfig.bind(OssFn)
OssFn.getOssConfig = getOssConfig.bind(OssFn)

module.exports = OssFn